<script type="text/javascript">
//图片选择callback
uploadPicCallback = function(data){
	jQuery('#syssite_preview').attr('src',GM.RootScript+'/img/'+data.pic_link+'.100x100.'+data.ext);
	jQuery('#SysSiteGallerySysPhotoId').val(data.pic_id);
};
</script>
<h1><?php echo $this->Html->image('bootstrap/posts.png')?>修改展示图片</h1>
<div class="bloc">
	<div class="title">
		<?php echo $this->element('admin/bread')?>
	</div>
    <div class="content">
    	<?php 
	    	echo $this->Form->create('SysSiteGallery');
    	?>
    	<table style = 'width:100%'>
		<tr>
			<td width = "50%">
		    <?php
		   		echo $this->Form->input('id',array('type'=>'hidden'));
				echo $this->Form->input('sys_website_id',array('type'=>'hidden'));
				?>
				<?php 
					echo $this->Form->input('sys_photo_id',array('type'=>'hidden'));
					if (isset($this->request->data['SysPhoto']['id']) && $this->request->data['SysPhoto']['id']>0){
						$imgsrc = thumb($this->request->data['SysPhoto']);
					}else{
						$imgsrc = 'Album.nopic.jpg';
					}
					echo $this->Html->image($imgsrc,array('style'=>'float:left','id'=>'syssite_preview'));
					echo $this->element('Album.ajaxUploadForm',array('upload'=>true,'list'=>true,'album_id'=>5,'userCallback'=>'uploadPicCallback'));
				?>
			</td>
			<td>
			<?php 
				echo $this->Form->input('title',array('label'=>'标题'));
			?>
			</td>
		</tr>
		<tr>
			<td>
				<?php 
					echo $this->Form->input('sort',array('label'=>'排序','default'=>100));
					echo $this->Form->input('enable',array('label'=>'启用','default'=>1,'type'=>'checkbox'));
				?>
			</td>
			<td>
				<?php 
					echo $this->Form->input('description',array('label'=>'链接','type'=>'text'));
				?>
			</td>
		</tr>
		</table>
	<?php echo $this->Form->end(__('Submit')); ?>
	</div>
</div>
